<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCWeb.Models.ViewData.CompanyNewViewData>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<title>Create</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">

    $(document).ready(function() {
        $("#form-sign-up").validate({
            rules: {
                CompanyId: {
                    required: true,
                    minLength: 8
                }
            },
            messages: {
                CompanyId: {
                    required: "Please provide a password",
                    minLength: "Your password must be at least 8 characters long"
                }
            }
        });
    });
</script>


    <h3 style="margin: .15in">Create</h2>

    <%= Html.ValidationSummary() %>

    <% using (Html.BeginForm("Create", "Company", FormMethod.Post, new { id = "form-sign-up" })) { %>

        <fieldset>
            <legend>Fields</legend>
            <p>
                <label for="CompanyId">CompanyId:</label>
                <%= Html.TextBox("CompanyId") %>
                <%= Html.ValidationMessage("CompanyId", "*") %>
            </p>
            <p>
                <label for="Name">Name:</label>
                <%= Html.TextBox("Name") %>
                <%= Html.ValidationMessage("Name", "*") %>
            </p>
            <p>
                <label for="PaymentURL">PaymentURL:</label>
                <%= Html.TextBox("PaymentURL") %>
                <%= Html.ValidationMessage("PaymentURL", "*") %>
            </p>
            
            <p>
                <label for="PayAddress1">PayAddress1:</label>
                <%= Html.TextBox("PayAddress1") %>
                <%= Html.ValidationMessage("PayAddress1", "*") %>
            </p>
            <p>
                <label for="PayAddress2">PayAddress2:</label>
                <%= Html.TextBox("PayAddress2") %>
                <%= Html.ValidationMessage("PayAddress2", "*") %>
            </p>
            <p>
                <%= Html.DropDownList("CompanyUserId", new SelectList(ViewData.Model.Users, "UserId", "Email" )) %>
            </p>
            <p>
                <input type="submit" value="Create" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%=Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

